
import os
from flask import Blueprint, jsonify,request
from flask_cors import CORS
import json

from service.analyzerService import AnalyzerService
from service.stockService import StockService
analyzer_controller = Blueprint('analyzer_controller', __name__)
CORS(analyzer_controller)

@analyzer_controller.route('/analyzer_stock',methods=['POST'])
def analyzerStock()->None:
    request_json = request.json
    analyzer_form = request_json['form']
    result = AnalyzerService().analyzerStock(analyzer_form)
    for i in result:
        i['date'] = i['date'].timestamp()
    return json.dumps(result)
#  json.dumps(result)
